eric7.Project.ProjectBrowserModel
Module implementing the browser model.
Global Attributes
Classes
Functions
ProjectBrowserDirectoryItem
Class implementing the data structure for project browser directory items.
Derived from
BrowserDirectoryItem, ProjectBrowserItemMixin
Class Attributes
Class Methods
Methods
Static Methods
ProjectBrowserDirectoryItem (Constructor)
ProjectBrowserDirectoryItem(parent, dinfo, projectType, full=True, bold=False, fsInterface=None)
Constructor
- parent (BrowserItem)
-
parent item
- dinfo (str)
-
dinfo is the string for the directory
- projectType (str)
-
type of file/directory in the project
- full (bool)
-
flag indicating full pathname should be displayed
- bold (bool)
-
flag indicating a highlighted font
- fsInterface (EricServerFileSystemInterface (optional))
-
reference to the 'eric-ide' server file system interface
(defaults to None)
ProjectBrowserFileItem
Class implementing the data structure for project browser file items.
Derived from
BrowserFileItem, ProjectBrowserItemMixin
Class Attributes
Class Methods
Methods
Static Methods
ProjectBrowserFileItem (Constructor)
ProjectBrowserFileItem(parent, finfo, projectType, full=True, bold=False, sourceLanguage="", fsInterface=None, )
Constructor
- parent (BrowserItem)
-
parent item
- finfo (str)
-
the string for the file
- projectType (str)
-
type of file/directory in the project
- full (bool)
-
flag indicating full pathname should be displayed
- bold (bool)
-
flag indicating a highlighted font
- sourceLanguage (str)
-
source code language of the project
- fsInterface (EricServerFileSystemInterface (optional))
-
reference to the 'eric-ide' server file system interface
(defaults to None)
ProjectBrowserItemMixin
Class implementing common methods of project browser items.
It is meant to be used as a mixin class.
Derived from
None
Class Attributes
Class Methods
Methods
Static Methods
ProjectBrowserItemMixin (Constructor)
ProjectBrowserItemMixin(type_, bold=False)
Constructor
- type_ (str)
-
type of file/directory in the project
- bold (bool)
-
flag indicating a highlighted font
ProjectBrowserItemMixin.addProjectType
addProjectType(type_)
Public method to add a type to the list.
- type_ (str)
-
type to add to the list
ProjectBrowserItemMixin.addVcsStatus
addVcsStatus(vcsStatus)
Public method to add the VCS status.
- vcsStatus (str)
-
VCS status text
ProjectBrowserItemMixin.getProjectTypes
getProjectTypes()
Public method to get the project type.
- Return:
-
project type
- Return Type:
-
str
ProjectBrowserItemMixin.getTextColor
getTextColor()
Public method to get the items text color.
- Return:
-
text color
- Return Type:
-
QColor
ProjectBrowserItemMixin.setVcsState
setVcsState(state)
Public method to set the items VCS state.
- state (str)
-
VCS state (one of A, C, M, U or " ")
ProjectBrowserItemMixin.setVcsStatus
setVcsStatus(vcsStatus)
Public method to set the VCS status.
- vcsStatus (str)
-
VCS status text
ProjectBrowserModel
Class implementing the project browser model.
Signals
- vcsStateChanged(str)
-
emitted after the VCS state has changed
Derived from
BrowserModel
Class Attributes
Class Methods
Methods
Static Methods
ProjectBrowserModel (Constructor)
ProjectBrowserModel(parent, fsInterface=None)
Constructor
- parent (Project.Project)
-
reference to parent object
- fsInterface (EricServerFileSystemInterface (optional))
-
reference to the 'eric-ide' server interface object
(defaults to None)
ProjectBrowserModel.__addVCSStatus
__addVCSStatus(item, name)
Private method used to set the vcs status of a node.
- item (BrowserItem)
-
item to work on
- name (str)
-
filename belonging to this item
ProjectBrowserModel.__changeParentsVCSState
__changeParentsVCSState(path, itemCache)
Private method to recursively change the parents VCS state.
- path (str)
-
pathname of parent item
- itemCache (dict)
-
reference to the item cache used to store
references to named items
ProjectBrowserModel.__updateVCSStatus
__updateVCSStatus(item, name, recursive=True)
Private method used to update the vcs status of a node.
- item (BrowserItem)
-
item to work on
- name (str)
-
filename belonging to this item
- recursive (bool)
-
flag indicating a recursive update
ProjectBrowserModel.addNewItem
addNewItem(typeString, name, additionalTypeStrings=None, simple=False)
Public method to add a new item to the model.
- typeString (str)
-
string denoting the type of the new item
- name (str)
-
name of the new item
- additionalTypeStrings (list of str (optional))
-
names of additional types (defaults to None)
- simple (bool (optional))
-
flag indicating to create a simple directory item and/or not
highlight the entry (defaults to False)
ProjectBrowserModel.changeVCSStates
changeVCSStates(statesList)
Public slot to record the (non normal) VCS states.
- statesList (list of str)
-
list of VCS state entries giving the states in the
first column and the path relative to the project directory starting
with the third column. The allowed status flags are:
- "A" path was added but not yet comitted
- "M" path has local changes
- "O" path was removed
- "R" path was deleted and then re-added
- "U" path needs an update
- "Z" path contains a conflict
- " " path is back at normal
ProjectBrowserModel.data
data(index, role)
Public method to get data of an item.
- index (QModelIndex)
-
index of the data to retrieve
- role (Qt.ItemDataRole)
-
role of data
- Return:
-
requested data
- Return Type:
-
Any
ProjectBrowserModel.entryCreated
entryCreated(path, isDir=False)
Public method to handle the creation of a file or directory.
- path (str)
-
path of the created file or directory
- isDir (bool (optional))
-
flag indicating a created directory (defaults to False)
ProjectBrowserModel.entryDeleted
entryDeleted(path, isDir=False)
Public method to handle the deletion of a file or directory.
- path (str)
-
path of the deleted file or directory
- isDir (bool (optional))
-
flag indicating a deleted directory (defaults to False)
- Return:
-
flag indicating a deletion
- Return Type:
-
bool
ProjectBrowserModel.entryMoved
entryMoved(srcPath, tgtPath)
Public slot handling the renaming of a non-managed file.
- srcPath (str)
-
original name
- tgtPath (str)
-
new name
ProjectBrowserModel.findChildItem
findChildItem(text, column, parentItem=None)
Public method to find a child item given some text.
- text (str)
-
text to search for
- column (int)
-
column to search in
- parentItem (BrowserItem)
-
reference to parent item
- Return:
-
reference to the item found
- Return Type:
-
BrowserItem
ProjectBrowserModel.findItem
findItem(name)
Public method to find an item given its name.
- name (str)
-
name of the item
- Return:
-
reference to the item found
- Return Type:
-
BrowserItem
ProjectBrowserModel.findParentItemByName
findParentItemByName(type_, name, dontSplit=False, signalTypeChange=False)
Public method to find an item given its name.
Note: This method creates all necessary parent items, if they
don't exist.
- type_ (str)
-
type of the item
- name (str)
-
name of the item
- dontSplit (bool (optional))
-
flag indicating the name should not be split (defaults to
False)
- signalTypeChange (bool (optional))
-
flag indicating to emit a signal indicating a change of
the non-visible project type of a directory item (defaults to False)
- Return:
-
reference to the item found and the new display name
- Return Type:
-
str
ProjectBrowserModel.itemIndexByName
itemIndexByName(name)
Public method to find an item's index given its name.
- name (str)
-
name of the item
- Return:
-
index of the item found
- Return Type:
-
QModelIndex
ProjectBrowserModel.itemIndexByNameAndLine
itemIndexByNameAndLine(name, lineno)
Public method to find an item's index given its name.
- name (str)
-
name of the item
- lineno (int)
-
one based line number of the item
- Return:
-
index of the item found
- Return Type:
-
QModelIndex
ProjectBrowserModel.populateItem
populateItem(parentItem, repopulate=False)
Public method to populate an item's subtree.
- parentItem (BrowserItem)
-
reference to the item to be populated
- repopulate (bool)
-
flag indicating a repopulation
ProjectBrowserModel.populateProjectDirectoryItem
populateProjectDirectoryItem(parentItem, repopulate=False)
Public method to populate a directory item's subtree.
- parentItem (BrowserItem)
-
reference to the directory item to be populated
- repopulate (bool)
-
flag indicating a repopulation
ProjectBrowserModel.preferencesChanged
preferencesChanged()
Public method used to handle a change in preferences.
ProjectBrowserModel.projectClosed
projectClosed()
Public method called after a project has been closed.
ProjectBrowserModel.projectOpened
projectOpened()
Public method used to populate the model after a project has been
opened.
ProjectBrowserModel.projectPropertiesChanged
projectPropertiesChanged()
Public method to react on a change of the project properties.
ProjectBrowserModel.removeItem
removeItem(name)
Public method to remove a named item.
- name (str)
-
file or directory name of the item
ProjectBrowserModel.renameItem
renameItem(name, newFilename)
Public method to rename an item.
- name (str)
-
the old display name
- newFilename (str)
-
new filename of the item
ProjectBrowserModel.repopulateItem
repopulateItem(name)
Public method to repopulate an item.
- name (str)
-
name of the file relative to the project root
ProjectBrowserModel.setProjectBrowserReference
setProjectBrowserReference(projectBrowser)
Public method to set a reference to the project browser instance.
- projectBrowser (ProjectBrowser)
-
reference to the project browser instance
ProjectBrowserModel.startFileSystemMonitoring
startFileSystemMonitoring()
Public method to (re)start monitoring the project file system.
ProjectBrowserModel.stopFileSystemMonitoring
stopFileSystemMonitoring()
Public method to stop monitoring the project file system.
ProjectBrowserModel.updateVCSStatus
updateVCSStatus(name, recursive=True)
Public method used to update the vcs status of a node.
- name (str)
-
filename belonging to this item
- recursive (bool)
-
flag indicating a recursive update
ProjectBrowserSimpleDirectoryItem
Class implementing the data structure for project browser simple directory
items.
Derived from
BrowserSimpleDirectoryItem, ProjectBrowserItemMixin
Class Attributes
Class Methods
Methods
Static Methods
ProjectBrowserSimpleDirectoryItem (Constructor)
ProjectBrowserSimpleDirectoryItem(parent, projectType, text, path="", fsInterface=None)
Constructor
- parent (BrowserItem)
-
parent item
- projectType (str)
-
type of file/directory in the project
- text (str)
-
text to be displayed
- path (str)
-
path of the directory
- fsInterface (EricServerFileSystemInterface (optional))
-
reference to the 'eric-ide' server file system interface
(defaults to None)